namespace ProduceBasicData.Api.DTO
{
    /// <summary>
    /// 产品物料DTO
    /// </summary>
    public class ProductMaterialDTO
    {
        public int Id { get; set; }
        
        /// <summary>
        /// 编码
        /// </summary>
        public string ProductNo { get; set; }
        
        /// <summary>
        /// 名称
        /// </summary>
        public string ProductName { get; set; }
        
        /// <summary>
        /// 规格型号
        /// </summary>
        public string Specification { get; set; }
        
        /// <summary>
        /// 单位
        /// </summary>
        public string Unit { get; set; }
        
        /// <summary>
        /// 预警值
        /// </summary>
        public int? WarningValue { get; set; }
        
        /// <summary>
        /// 群组类型ID
        /// </summary>
        public int GroupTypeId { get; set; }
        
        /// <summary>
        /// 群组类型
        /// </summary>
        public string GroupType { get; set; }
        
        /// <summary>
        /// 群组ID
        /// </summary>
        public int? GroupId { get; set; }
        
        /// <summary>
        /// 群组名称
        /// </summary>
        public string GroupName { get; set; }
        
        /// <summary>
        /// 默认工艺路线ID
        /// </summary>
        public int? DefaultCraftId { get; set; }
        
        /// <summary>
        /// 默认工艺路线名称
        /// </summary>
        public string DefaultCraftName { get; set; }
        
        /// <summary>
        /// 是否显示默认工艺路线（只有半成品和成品时显示）
        /// </summary>
        public bool ShowDefaultCraft => GroupType == "半成品" || GroupType == "成品";
        
        /// <summary>
        /// 描述
        /// </summary>
        public string ProductDesc { get; set; }
        
        /// <summary>
        /// 创建人
        /// </summary>
        public string CreateName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新人
        /// </summary>
        public string? UpdateName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        public DateTime? UpdateTime { get; set; }
    }
}